/**
 * Project hdmap
 * @author shengjialiang
 * @version v1.0
 */


#ifndef _IEVENTHANDLER_H
#define _IEVENTHANDLER_H

#include "map_common/CommonConfig.h"

namespace Common
{
    class IEvent;
    class MAP_COMMON_EXPORTS IEventHandler 
    {
    public:
        IEventHandler();

        virtual ~IEventHandler();

        virtual bool onEvent(Common::IEvent* in_pEvent) = 0;
    };

    class MAP_COMMON_EXPORTS CEventHandlerRegister
    {
    public:
        CEventHandlerRegister();

        virtual ~CEventHandlerRegister();

        bool registerHandler(Common::IEventHandler* in_pRefHandler);

        bool unRegisterHandler(Common::IEventHandler* in_pHandler);

        void notifyHandlers(Common::IEvent* in_pEvent);

    protected:
        std::vector<Common::IEventHandler*> mEventHandlers;
    };
}
#endif //_IEVENTHANDLER_H